package com.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @ProjectName: study
 * @Package: com.utils
 * @ClassName: DataUtils
 * @Author: zzh
 * @Description: 时间转化类
 * @Date: 2021/7/31 11:40
 * @Version: 1.0
 */
public class DataUtils {

    public static String timeStamp2Date(String seconds,String format) {
        if(seconds == null || seconds.isEmpty() || seconds.equals("null")){
            return "";
        }
        if(format == null || format.isEmpty()){
            format = "yyyy-MM-dd HH:mm:ss";
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(new Date(Long.valueOf(seconds)));
    }

}
